import request from '@/utils/request'

//库存模块
// 查询存储库存信息的列表
export function listStock(query) {
    return request({
        url: '/restock/stock/list',
        method: 'get',
        params: query
    })
}

export function getListStock(query){
    console.log(query)
    return request({
        url: '/restock/stock/stockList',
        method: 'get',
        params: query
    })
}

// 查询存储库存信息的详细
export function getStock(id) {
    return request({
        url: '/restock/stock/' + id,
        method: 'get'
    })
}

// 新增存储库存信息的
export function addStock(data) {
    return request({
        url: '/restock/stock',
        method: 'post',
        data: data
    })
}

// 修改存储库存信息的
export function updateStock(data) {
    return request({
        url: '/restock/stock',
        method: 'put',
        data: data
    })
}

// 删除存储库存信息的
export function delStock(id) {
    return request({
        url: '/restock/stock/' + id,
        method: 'delete'
    })
}

// 获取门店名称
export function getStoreInfoName(){
    return request({
        url: '/restock/stock/store',
        method: 'get'
    })
}
// 获取当前店长的门店名称
export function queryStoreInfo(){
    return request({
        url: '/restock/stock/storeInfo',
        method: 'get'
    })
}

// 补货模块
// 查询存储补货请求的列表
export function listRestock(query) {
    console.log(query)
    return request({
        url: '/restock/restock/list',
        method: 'get',
        params: query
    })
}

// 查询存储补货请求的详细
export function getRestock(replenishId) {
    return request({
        url: '/restock/restock/' + replenishId,
        method: 'get'
    })
}

// 新增存储补货请求的
export function addRestock(data) {
    return request({
        url: '/restock/restock',
        method: 'post',
        data: data
    })
}

// 修改存储补货请求的
export function updateRestock(data) {
    return request({
        url: '/restock/restock',
        method: 'put',
        data: data
    })
}

// 删除存储补货请求的
export function delRestock(replenishId) {
    return request({
        url: '/restock/restock/' + replenishId,
        method: 'delete'
    })
}


//库存详情模块
export function getStockDetail(id) {
    return request({
        url: '/restock/restock/getDetail/' + id,
        method: 'get'
    })
}

export function updateStockDetail(id) {
    return request({
        url: '/restock/restock/addDetail/' + id,
        method: 'get'
    })
}

//补货申请发送,提交审核
export function sendRestock(data) {
    return request({
        url: '/restock/restock/send',
        method: 'post',
        data: data
    })
}

export function submitRestock(data) {
    // console.log(data)
    return request({
        url: '/restock/restock/submit',
        method: 'post',
        data: data
    })
}

export function  saveRestock(data){
    return request({
        url: '/restock/restock/save',
        method: 'post',
        data: data
    })
}

